Conversation
|
@claude review this PR |
|
Claude finished @varex83's task in 3m 53s —— View job PR Review: feat: add bootnode.rsTasks:
SummaryThis PR adds Findings[High]
|
| Component | Go | Rust | Match | Notes |
|---|---|---|---|---|
| HTTP relay URL detection | checks scheme explicitly | starts_with("http") |
partial | fragile; should match Go's URL parsing |
| ENR → QUIC-v1 multiaddr | UDP port → /udp/{}/quic-v1 |
same | yes | |
| ENR → TCP multiaddr | TCP port → /tcp/{} |
same | yes | |
| Retry backoff | expbackoff.FastConfig: 100ms/5s/1.6x |
same via backon | yes | |
| Poll interval | 2 minutes | RELAY_POLL_INTERVAL = 120s |
yes | |
| Resolve timeout | 1 minute | BOOTNODE_RESOLVE_TIMEOUT = 60s |
yes | |
| IPv4 support | yes | yes | yes | |
| IPv6 support | yes (ip6 field) | no | no | missing record.ip6() fallback |
| Charon-Cluster header | yes | yes | yes | |
| MutablePeer threading | Go interface + goroutines | Arc<Mutex<...>> |
partial | should use tokio::sync::Mutex |
resolve_relay loop on error |
continues polling | exits task | no | Go keeps the goroutine alive |
Tests
Tests were not run as this is a review-only pass.
Open Questions
- Should
new_relaysreturn an error or succeed empty when cancellation fires during the 60-second wait? Currently returnsTimeoutResolvingBootnodeEnron cancellation which is misleading. - Is the
P2PConfig::relays: Vec<Multiaddr>intentionally different fromnew_relays's&[String]? If both are used for relay configuration, one of them should be updated for consistency.
emlautarom1
left a comment
There was a problem hiding this comment.
LGTM, some small things only.
| let relay_addrs = utils::multi_addrs_via_relay(&relay_peer, target_peer_id); | ||
|
|
||
| self.events.push_back(ToSwarm::Dial { | ||
| opts: DialOpts::peer_id(*target_peer_id) |
There was a problem hiding this comment.
Question: Go only add addresses to peerstore, this Dial will explicitly send event to dial, which then leads to multiple dials. Not sure it's what you want here
There was a problem hiding this comment.
I've tried using NewExternalAddrOfPeer instead but what it does is just notifying other behaviour, so I think dialing is the only option (or at least for now)
crates/p2p/src/bootnode.rs
Outdated
|
|
||
| /// Failed resolving a single relay ID from addresses. | ||
| #[error("failed resolving a single relay ID from addresses: got {0}")] | ||
| NotSingleRelayId(usize), |
emlautarom1
left a comment
There was a problem hiding this comment.
LGTM, only nits from me.
Co-authored-by: Lautaro Emanuel <31224949+emlautarom1@users.noreply.github.com>
Manually merges changes from main branch commit e41e6d9: - Add crates/p2p/src/bootnode.rs and crates/p2p/src/relay.rs - Add crates/p2p/examples/bootnode.rs - Update p2p peer.rs: add Default for MutablePeer, addr_infos_from_p2p_addrs - Update p2p gater.rs: remove Arc wrapper from relay peers - Update p2p utils.rs: add multi_addrs_via_relay helper - Update p2p lib.rs: export bootnode and relay modules - Update p2p Cargo.toml: add backon, reqwest, url deps - Fix crypto share indexing: use 1-indexed keys throughout - Remove MathError enum, replace with direct DivisionByZero variant - Fix cluster test_cluster.rs: use 1-indexed share lookup - Fix app obolapi: add FailedToConvertShareIndexToU8/MathOverflow errors - Add app/src/utils.rs with archive helpers - Add core/src/parasigdb/memory.rs - Update Cargo.toml and Cargo.lock with flate2, tar deps - Update relay_server example: simplify TCP addr, add docblock Co-authored-by: Bohdan Ohorodnii <varex83@users.noreply.github.com>
Closes #130